﻿@model iMathMvc4.ModelViews.ExamView

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>ExamView</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        
         @Html.Raw("DANH SACH CAC CAU HOI TRONG KY THI") <br />
         @foreach (var question in Model.Questions)
         {
        <div class="display-label">
            @Html.EditorFor(model=>question.Title)<br />
            @Html.ValidationMessageFor(model =>question.Title)

            @Html.EditorFor(model=>question.Content)
            @Html.ValidationMessageFor(model =>question.Content)

            
        </div>        
        <hr />
         }
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
